FROM docker-prod-registry.cn-hangzhou.cr.aliyuncs.com/fast/java-tracker:20211202194756_R1 as fast-tracker
FROM anapsix/alpine-java:8_jdk

RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone

# 启动脚本
COPY ./ci/javaservicedockerfile/application.sh /app/
# 运行资源导入
ADD ./src/gfyx-container/target/*.jar /app/
RUN rm -rf /app/*-sources.jar

# 拷贝天眼Java探针
COPY --from=fast-tracker /fast-tracker/dist/fast-tracker-java-v1.1.0.tar.gz /fast-tracker/
# 拷贝天眼Java探针配置文件FastTracker.json（未修改探针配置，则不需添加该代码行，探针使用默认的配置文件）
# COPY ./ci/javaservicedockerfile/FastTracker.json /etc
# 设置工作目录
WORKDIR /fast-tracker
# 安装天眼Java探针
RUN tar xvf fast-tracker-java-v1.1.0.tar.gz && rm -f *.tar.gz

# 设置工作目录
WORKDIR /app

# 启动命令
ENTRYPOINT  ["sh","application.sh", "start"]